<%--
 - Copyright (c) 2009-2011 ETCORE Labs. All rights reserved. 
 - 
 - This software is the confidential and proprietary information of ETCORE Labs. 
 - You shall not disclose such confidential information and shall use it only
 - in accordance with the terms of the license agreement you entered into
 - with ETCORE Labs.
 -
 - Support can be obtained from support forums at:
 - http://www.etcore.com/
 -
 - @author: ETCORE GroupTalk developers
 -
 --%>
<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib uri="http://jakarta.apache.org/taglibs/core" prefix="c"%>
<%@ taglib uri="http://www.etcore.com/grouptalk" prefix="grouptalk"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<title><c:out value='${context.edit}' />-<c:out
	value='${messageDetail.name}' />-<c:out value='${context.title}' /></title>
<link rel="stylesheet" href="/group/css/styles.css" type="text/css">
<script>
 
var width=window.screen.width;
 
var n=10;
if(width>=1600){
n=12;
 
}else if(width<=800){
n=8;
 	
}
</script>
<script>
var ie =navigator.appName=="Microsoft Internet Explorer"?true:false;
function $(objID){
	return document.getElementById(objID);
}
function enableControl()
{

	var element=document.getElementById("editTagsControl");
	var selects=element.getElementsByTagName("select");
	if(editMessageForm.editTags.checked){
	 for ( var i=0; i<selects.length; i++ ){
		 selects[i].disabled=false;
	 }

	}
	else
	{
	for ( var i=0; i<selects.length; i++ ){
		 selects[i].disabled=true;
	 }
	}
}
</script>
<style>
body {
	font-size: 12px;
	font-family: Verdana, Arial, "宋体";
}

a:link {
	color: #464646;
	text-decoration: none;
}

a:visited {
	color: #464646;
	text-decoration: none;
}

a:hover {
	color: #ed145b;
	text-decoration: underline;
}

a:active {
	color: #ed145b;
	text-decoration: underline;
}

td {
	font-size: 12px
}

/*Date*/
.header {
	font: 12px Arial, Tahoma !important;
	font-weight: bold !important;
	font: 11px Arial, Tahoma;
	font-weight: bold;
	color: #154BA0;
	background: #C2DEED;
	height: 25px;
	padding-left: 10px;
}

.header td {
	padding-left: 10px;
}

.header a {
	color: #154BA0;
}

.header input {
	background: none;
	vertical-align: middle;
	height: 16px;
}

.category {
	font: 12px Arial, Tahoma !important;
	font: 11px Arial, Tahoma;
	color: #92A05A;
	height: 20px;
	background-color: #FFFFD9;
}

.category td {
	border-bottom: 1px solid #DEDEB8;
}

.expire,.expire a:link,.expire a:visited {
	color: #999999;
}

.default,.default a:link,.default a:visited {
	color: #000000;
}

.checked,.checked a:link,.checked a:visited {
	color: #FF0000;
}

.today,.today a:link,.today a:visited {
	color: #00BB00;
}

#calendar_year {
	display: none;
	line-height: 130%;
	background: #FFFFFF;
	position: absolute;
	z-index: 1005;
}

#calendar_year .col {
	float: left;
	background: #FFFFFF;
	margin-left: 1px;
	border: 1px solid #86B9D6;
	padding: 4px;
}

#calendar_month {
	display: none;
	background: #FFFFFF;
	line-height: 130%;
	border: 1px solid #86B9D6;
	padding: 4px;
	position: absolute;
	z-index: 1006;
}

.tableborder {
	background: white;
	border: 1px solid #86B9D6;
}

#year,#month {
	padding-right: 10px;
	background: url(onbottom.gif) no-repeat center right;
}
/*Date*/
</style>

<script language="javascript">

function checkEditMessageForm()
{
if(editMessageForm.name.value==""||editMessageForm.name.value.replace(/(^\s*)|(\s*$)/g, "")=="")
{
alert("<c:out value='${context.msg_title_null}'/>");
editMessageForm.name.focus();
return false;
}
if(editMessageForm.tid.value==""||editMessageForm.tid.value=="-1")
{
alert("<c:out value='${context.msg_topic_error}'/>");
editMessageForm.tid.focus();
return false;
}
 
return true;
}
</script>
<c:if test="${isAdmin }">
	<script type="text/javascript"
		src="/group/ui-component/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
	<script type="text/javascript">
	tinyMCE.init({
		 // General options
         mode : "exact",
        elements : "content",
        theme : "advanced",    
        plugins : "spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
        <c:if test="${lang eq 'local'}"> language: "zh",</c:if>
        // Theme options
        theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
        theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
        theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
        theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "center",
        theme_advanced_statusbar_location : "bottom",
        theme_advanced_resizing : true,
        theme_advanced_source_editor_height:"300",
        // Skin options
        skin : "o2k7",
        skin_variant : "silver"
	});
</script>

</c:if>


</head>

<body bottomMargin=0 leftMargin=10 topMargin=0 onload=preloadImages()
	rightMargin=10 marginheight="0"">

<c:import url="/group/ui-component/divdialog/divdialog.html" />
<table width="100%" border="0" cellpadding="0" cellspacing="0"
	align=center>
	<%-- //////////////////////banner --%>
	<tr>
		<td><c:import url="/banner.jsp?currentPlatform=${group.open }" /></td>
	</tr>
	<%--////////////////////// mid --%>

	<tr>
		<td>
		<table width=100%>

			<tr>


				<td width=100%><c:set var="platform"
					value="platform${group.open}" /> <c:set var="platformLabel"
					value="${context[platform]}" /> <c:set var="currentViewer"
					value="groupadmin" /><c:set var="platformViewer"
					value="groupadmin" /> <c:set var="groupViewer" value="groupdetail" /><c:set
					var="posturl" value="?" /> <c:set var="encryptedUrl" value="" />
				<c:if test="${group.open==3 }">
					<c:set var="currentViewer" value="bookmarks" />
					<c:set var="groupViewer" value="bookmarksadmin" />
				</c:if> <c:if test="${group.open==1 }">
					<c:set var="currentViewer" value="news" />
					<c:set var="posturl" value="?nav=${group.nav }" />
					<c:if test="${group.nav==1 }">
						<c:set var="platformLabel" value="${context.nav1}" />
					</c:if>
				</c:if> <c:if test="${group.open==2 }">
					<c:set var="currentViewer" value="community" />
					<c:if test="${group.nav==1 }">
						<c:set var="platformLabel" value="${context.nav2}" />
					</c:if>
					<c:set var="posturl" value="?nav=${group.nav }" />
				</c:if> <c:if test="${group.open==4 }">
					<c:set var="currentViewer" value="reminders" />
				</c:if> <c:if test="${group.open==0 }">
					<c:set var="posturl" value="?open=0" />
				</c:if>
				<TABLE cellSpacing=0 cellPadding=0 width=100% border=0>
					<TBODY>

						<tr>
							<td width=100%>
							<table>
								<tr>
									<td style="margin-left: 15px; color: #808080"><a href="/"
										style="color: #3B5998">${context.homepage }</a> -> <a
										href="${currentViewer }${context.postfix}${posturl}"
										style="color: #3B5998">${platformLabel }</a><c:if
										test="${group.open!=4 }"> -> <a style="color: #3B5998"
											href="/group/${page}${context.postfix}?id=${group.id}&gid=${group.id}">${group.name
										}</a>
									</c:if></td>
								</tr>


							</table>
							</td>
						</tr>


						<tr>
							<td align=center>


							<form name="editMessageForm"
								onSubmit="return checkEditMessageForm();" method=post
								action="/group/editMessage<c:out value='${context.postfix}'/>?id=<c:out value='${param.id}'/>&opera=merge">
							<table cellpadding=0 cellspacing=1
								style="border: 1px solid #d2d4d2" align=center>



								<tr bgcolor="#ffffff">


									<td style="color: #808080" colspan=2><c:if
										test="${isAdmin }">
										<a style="color: #3B5998"
											href="/group/groupadmin${context.postfix}">${context.management
										}</a> -> <a
											href="${platformViewer }${context.postfix}${posturl}&open=${group.open}"
											style="color: #3B5998">${platformLabel }</a> -> <a
											style="color: #3B5998"
											href="/group/${groupViewer}${context.postfix}?id=${group.id}&gid=${group.id}">${group.name
										}</a> -> <a style="color: #3B5998"
											href="/group/${groupViewer}${context.postfix}?id=${group.id}&gid=${group.id}&tid=${topic.id}">${topic.name
										}</a>
									</c:if> &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a
										style="color: #808080"
										href="/group/messagedetail<c:out value='${context.postfix}'/>?id=<c:out value='${param.id}'/>"><c:out
										value='${context.view}' /></a></TD>
								</TR>

								<tr bgcolor="#ffffff">

									<TD><c:out value='${context.msg_title}' />:</td>
									<td><input type=text name="name" size=70 maxlength=500
										value="<c:out value='${messageDetail.name}'/>"></TD>
								</TR>
								<c:if test="${isAdmin }">
									<tr bgcolor="#ffffff">

										<TD><c:out value='${context.change_time}' />：&nbsp;</td>
										<td><select name=changeTime> 
											<option value="false">No</option>
											<option value="true">Yes</option> 
										</select></TD>
									</TR>
									<tr bgcolor="#ffffff">

										<TD><c:out value='${context.change_author}' />：&nbsp;</td>
										<td><select name=changeAuthor> 
											<option value="false">No</option>
											<option value="true">Yes</option> 
										</select></TD>
									</TR>
									<tr bgcolor="#ffffff">

										<TD><c:out value='${context.text_abstract}' />:&nbsp;</td>
										<td><textarea id="abstract" name=tag cols="70" rows="6"
											class="textarea"><c:out
											value='${messageDetail.tag}' /></textarea></TD>
									</TR>
									<c:if test="${group.open!=1&& group.open!=2&&group.open!=0}">
										<script type="text/javascript"
											src="/group/ui-component/calendar/js/calendar.js"></script>
										<tr bgcolor="#ffffff">

											<TD><c:if test="${group.open==4 }">
												<c:out value='${context.text_start}' />
											</c:if><c:if test="${group.open!=4 }">
												<c:out value='${context.source_url}' />
											</c:if>:&nbsp;</td>
											<td><input type=text name="source"
												<c:if test="${group.open==4 }"> readonly="readonly" onClick="showcalendar(event, this);" onFocus="showcalendar(event, this);if(this.value=='0000-00-00')this.value=''"</c:if>
												size=25 maxlength=200
												value="<c:out value='${messageDetail.source}'/>"></TD>
										</TR>
										<tr bgcolor="#ffffff">

											<TD><c:if test="${group.open==4 }">
												<c:out value='${context.text_end}' />
											</c:if> <c:if test="${group.open!=4 }">
												<c:out value='${context.source_time}' />
											</c:if>:&nbsp;</TD>
											<td><input type=text
												<c:if test="${group.open==4 }"> readonly="readonly" onClick="showcalendar(event, this);" onFocus="showcalendar(event, this);if(this.value=='0000-00-00')this.value=''"</c:if>
												name="stime" size=25 maxlength=40
												value="<c:out value='${messageDetail.stime}'/>"></TD>
										</TR>
									</c:if>
								</c:if>
								<tr bgcolor="#ffffff">

									<TD><c:out value='${context.msg_topic}' />：&nbsp;</td>
									<td><select name=tid>
										<c:forEach var="currentTopic" items="${topics }">
											<option value="<c:out value='${currentTopic.id}'/>"
												<c:if test="${currentTopic.id==topic.id }">selected</c:if>><c:out
												value='${currentTopic.name}' /></option>

										</c:forEach>

									</select></TD>
								</TR>
								<c:if
									test="${(group.open==1||group.open==2)&&group.nav==0 &&not empty tagContainerCount&&tagContainerCount>0}">
									<tr>
										<td>${context.tag_management }<input type=checkbox
											name=editTags value="1" onclick="enableControl()">:&nbsp;</td>
										<td>
										<div id=editTagsControl
											style="width: 560px; height: 165; overflow: auto;">
										<table style="border: 1px solid #d2d4d2;">
											<c:set var="containerCount" value="0" />
											<c:forEach var="tagContainer" items="${tagContainers}">
												<c:if test="${containerCount%2==0 }">
													<tr>
												</c:if>
												<td nowrap><font color="#999999">${tagContainer.name
												}</font></td>
												<td><select disabled name="tcid${tagContainer.id}"
													multiple size=3 style="width: 150px; overflow: auto;">
													<option value="-1"><c:out
														value='${context.msg_select_tag}' /></option>
													<c:set var="tags" value="${tagContainer.id }tags" />
													<c:forEach var="tag" items="${requestScope[tags]}">
														<c:set var="tagAdded" value="${tag.id }tagAdded" />

														<option
															<c:if test="${ requestScope[tagAdded]}">selected</c:if>
															value="<c:out value='${tag.id }' />"><c:out
															value='${tag.name}' /></option>
													</c:forEach>
												</select></td>
												<c:if test="${containerCount%2==1 }">
													</tr>
												</c:if>

												<c:set var="containerCount" value="${containerCount+1 }" />
											</c:forEach>
										</table>
										</div>
										</td>
									</tr>
								</c:if>
								<tr bgcolor="#ffffff">

									<TD colspan=2><textarea id="content" name=content
										cols="70" rows="20" class="textarea"><c:out
										value='${messageDetail.content}' escapeXml="false" /></textarea></TD>

								</TR>

								<tr bgcolor="#ffffff">

									<TD align=center width=100% colspan=2><input type=submit
										value="<c:out value='${context.button_ok}'/>"></TD>

								</TR>

							</table>
							</form>
							</TD>
						</TR>
					</TBODY>
				</TABLE>

				</td>
			</tr>
		</table>
		</td>
	</tr>

	<tr>
		<td><BR>
		<BR>
		<c:import url="/footer.jsp" /></td>
	</tr>


</table>


<c:if test="${not empty msg}">
	<script>alert('${msg }')</script>
</c:if>


</body>
</html>


